home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group00a.txt
/
000056_icon-group-sender _Mon Apr 10 10:14:32 2000.msg
< prev
next >
Wrap
Internet Message Format
|
2001-01-03
|
2KB
Return-Path: <icon-group-sender>
Received: (from root@localhost)
by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id KAA11146
for icon-group-addresses; Mon, 10 Apr 2000 10:14:24 -0700 (MST)
Message-Id: <200004101714.KAA11146@baskerville.CS.Arizona.EDU>
Date: Mon, 10 Apr 2000 09:48:05 -0700
From: Steve Wampler <swampler@noao.edu>
X-Accept-Language: en
To: "Udut, Kenneth" <kenneth.udut@spcorp.com>,
icon-group <icon-group@optima.CS.Arizona.EDU>
Subject: Re: s1 ~=== s2 : s2
Errors-To: icon-group-errors@optima.CS.Arizona.EDU
Status: RO
"Udut, Kenneth" wrote:
>
> My question:
>
> >From the helpfile:
>
> s1 ~=== s2 : s2 -- compare values
>
> x1 ~=== x2 produces the value of x2
> if x1 and x2 do not have the same value, but fails otherwise.
>
> Now - I'm wondering, is this the same
> as saying in BASIC:
>
> PROCEDURE COMPARE()
>
> A$=""
> IF X$ <> Y$, THEN LET A$=Y$
>
> END
>
> Or, one of my favorite little formulas in
> Excel:
>
> =if(a2=a1,"",a2)
>
> Is the
>
> s1 ~=== s2: s2
>
> the same as that Excel function or that visual basic procedure?
>
> -Kenneth
No. Also, carefully consider the differences in Icon between == (~==) and
=== (~===). It's unlikely that ~=== is equivalent to <> in BASIC.
However, s1 ~== s2 is very close to both of the above. (I assume that
A$ gets returned by the COMPARE procedure in BASIC?)
The fundamental difference is on expression failure (not a concept in
either BASIC or excel, hence the difficulty in mapping).
For example, to match the excel expression, you'd need:
(s1 ~== s2) | ""
though you probably don't want to produce an exact match anyway, as that
takes away the advantages offered by having expressions succeed or fail.
--
Steve Wampler- SOLIS Project, National Solar Observatory
swampler@noao.edu